<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Formats all rows of a query into a HTML table</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.ifx-getsqlca.html">ifx_getsqlca</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.ifx-nullformat.html">ifx_nullformat</a></div>
 <div class="up"><a href="ref.ifx.html">Informix 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.ifx-htmltbl-result" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ifx_htmltbl_result</h1>
  <p class="verinfo">(PHP 4, PHP &lt;=5.2.0)</p><p class="refpurpose"><span class="refname">ifx_htmltbl_result</span> &mdash; <span class="dc-title">Formats all rows of a query into a HTML table</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.ifx-htmltbl-result-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">int</span> <span class="methodname"><strong>ifx_htmltbl_result</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$result_id</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$html_table_options</code></span>
  ] )</div>

  <p class="para rdfs-comment">
   Formats and prints all rows of the <em><code class="parameter">result_id</code></em> query
   into a HTML table. 
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ifx-htmltbl-result-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">result_id</code></em></dt>

     <dd>

      <p class="para">
       <em><code class="parameter">result_id</code></em> is a valid resultid returned by
       <span class="function"><a href="function.ifx-query.html" class="function">ifx_query()</a></span> or
       <span class="function"><a href="function.ifx-prepare.html" class="function">ifx_prepare()</a></span> (select type queries only!).
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">html_table_options</code></em></dt>

     <dd>

      <p class="para">
       This optional argument is a string of &lt;table&gt; tag options.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ifx-htmltbl-result-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the number of fetched rows, or <strong><code>FALSE</code></strong> on errors.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.ifx-htmltbl-result-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-1175">
    <p><strong>Example #1 Informix results as HTML table</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$rid&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ifx_prepare&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">"select&nbsp;*&nbsp;from&nbsp;emp&nbsp;where&nbsp;name&nbsp;like&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$name</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$connid</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IFX_SCROLL</span><span style="color: #007700">);<br />if&nbsp;(!&nbsp;</span><span style="color: #0000BB">$rid</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;...&nbsp;error&nbsp;...&nbsp;*/<br /></span><span style="color: #007700">}<br /></span><span style="color: #0000BB">$rowcount&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ifx_affected_rows&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$rid</span><span style="color: #007700">);<br />if&nbsp;(</span><span style="color: #0000BB">$rowcount&nbsp;</span><span style="color: #007700">&gt;&nbsp;</span><span style="color: #0000BB">1000</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">printf&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">"Too&nbsp;many&nbsp;rows&nbsp;in&nbsp;result&nbsp;set&nbsp;(%d)\n&lt;br&nbsp;/&gt;"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$rowcount</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;die&nbsp;(</span><span style="color: #DD0000">"Please&nbsp;restrict&nbsp;your&nbsp;query&lt;br&nbsp;/&gt;\n"</span><span style="color: #007700">);<br />}<br />if&nbsp;(!&nbsp;</span><span style="color: #0000BB">ifx_do</span><span style="color: #007700">(</span><span style="color: #0000BB">$rid</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;...&nbsp;error&nbsp;...&nbsp;*/<br /></span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB">ifx_htmltbl_result&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$rid</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"border=\"2\""</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">ifx_free_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$rid</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.ifx-getsqlca.html">ifx_getsqlca</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.ifx-nullformat.html">ifx_nullformat</a></div>
 <div class="up"><a href="ref.ifx.html">Informix 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
